import com.lucastex.grails.fileuploader.UFile

class ArticleAjaxController {

    def sharedSelect = { 
         //[teacherInstanceList: User.findAllByEnabled(true) ]
    }
 // 上传处理页面
    def upload = {
        log.info "Uploaded file with id=${params.ufile}"
         
        if (flash.message) { 
            log.info "${flash.message}"
            render(text:"{'success': false, 'message':  '${flash.message}'}")
        }else{
            def ufile = UFile.get(params.ufileId.toLong())
            log.info "{'success': true, 'message':  {'id':${ufile.id} , 'name':${ufile.name} , 'size':${ufile.size} }}"
            render(text:"{'success': true, 'message':  {'id':'${ufile.id}' , 'name':'${ufile.name}' , 'size':'${ufile.size}' }}")
        }
    }
}
